<?php

namespace app\controller;

use think\facade\Db;
use think\Request;
use app\BaseController;

class Index extends BaseController
{
    public function protocol(Request $request)
    {
        $id = str_replace('index/protocol/', '', $request->pathinfo());
        if (empty($id)) {
            return json()->data(['code' => 400, 'msg' => '系统繁忙,请稍后再试']);
        } else {
            return json()->data(['code' => 200, 'data' =>  Db::name('protocol')->find($id), 'msg' => '成功']);
        }
    }
    public function link(Request $request)
    {
        return json()->data(['code' => 200, 'data' =>  Db::name('link')->select(), 'msg' => '成功']);
    }
}
